
/*

class MyArray<T> {
    public Object[] objects = new Object[10];
    public void setValue(int pos,T val) {
        objects[pos] = val;
    }
    public T getValue(int pos) {
        return (T)objects[pos];
    }
}
*/

/*
class Alg2 {
    public static <T extends Comparable<T>> T findMaxValue(T[] array) {
        T max = array[0];
        for(int i=0;i<array.length;i++) {
            if(max.compareTo(array[i])<0) {
                max = array[i];
            }
        }
        return max;
    }
}*/


class Alg<T extends Comparable<T>> {
    public T findMaxValue(T[] array) {
        T max = array[0];
        for(int i=0;i<array.length;i++) {
            if(max.compareTo(array[i])<0) {
                max = array[i];
            }
        }
        return max;
    }
}

public class Test {
    public static void main(String[] args) {
        Integer[] array = {1,2,3,4,5};
        Alg<Integer> alg = new Alg<>();
        Integer max = alg.findMaxValue(array);
        System.out.println(max);
    }
}















